using System;
using System.Collections.Generic;

namespace LibraryManagementSystem
{
    /// <summary>
    /// 图书信息类
    /// </summary>
    public class Book
    {
        public int Id { get; set; }
        public string ISBN { get; set; }
        public string Title { get; set; }
        public string Author { get; set; }
        public string Publisher { get; set; }
        public DateTime? PublishDate { get; set; }
        public int CategoryId { get; set; }
        public decimal? Price { get; set; }
        public int? Pages { get; set; }
        public string Description { get; set; }
        public string CoverImage { get; set; }
        public string Location { get; set; }
        public string Status { get; set; }
        public DateTime CreatedAt { get; set; }
        
        // 导航属性
        public BookCategory Category { get; set; }
        public List<BookItem> Items { get; set; }
    }

    /// <summary>
    /// 图书分类类
    /// </summary>
    public class BookCategory
    {
        public int Id { get; set; }
        public string CategoryCode { get; set; }
        public string CategoryName { get; set; }
        public int? ParentId { get; set; }
        public string Description { get; set; }
        public DateTime CreatedAt { get; set; }
        
        // 导航属性
        public BookCategory Parent { get; set; }
        public List<BookCategory> Children { get; set; }
        public List<Book> Books { get; set; }
    }

    /// <summary>
    /// 图书副本类（实体书）
    /// </summary>
    public class BookItem
    {
        public int Id { get; set; }
        public int BookId { get; set; }
        public string BarCode { get; set; }
        public string Status { get; set; }
        public DateTime AcquisitionDate { get; set; }
        public DateTime? LastBorrowDate { get; set; }
        public string Notes { get; set; }
        public DateTime CreatedAt { get; set; }
        
        // 导航属性
        public Book Book { get; set; }
        public List<Borrowing> Borrowings { get; set; }
    }

    /// <summary>
    /// 借阅记录类
    /// </summary>
    public class Borrowing
    {
        public int Id { get; set; }
        public int BookItemId { get; set; }
        public int UserId { get; set; }
        public DateTime BorrowDate { get; set; }
        public DateTime DueDate { get; set; }
        public DateTime? ReturnDate { get; set; }
        public bool IsReturned { get; set; }
        public decimal FineAmount { get; set; }
        public string Notes { get; set; }
        public DateTime CreatedAt { get; set; }
        
        // 导航属性
        public BookItem BookItem { get; set; }
        public User User { get; set; }
    }

    /// <summary>
    /// 预约记录类
    /// </summary>
    public class Reservation
    {
        public int Id { get; set; }
        public int BookId { get; set; }
        public int UserId { get; set; }
        public DateTime ReservationDate { get; set; }
        public DateTime ExpiryDate { get; set; }
        public string Status { get; set; }
        public DateTime CreatedAt { get; set; }
        
        // 导航属性
        public Book Book { get; set; }
        public User User { get; set; }
    }
} 